<template>
  <el-header class="bg-primary">
    <Header></Header>
  </el-header>
  <el-main style="padding: 0 !important">
    <el-row v-for="item in list" :key="item.fromId" style="border-bottom: 1px solid #f1f1f1">
      <div style="width: 15%; display: flex">
        <img style="width: 100%; border-radius: 8px" :src="item.avatar" alt="" />
      </div>
      <div style="width: 70%">
        <div style="padding: 3px 5px">
          <div>{{ item.username }}</div>
          <div class="message">{{ item.message }}</div>
        </div>
      </div>
      <div style="width: 15%; text-align: right">
        <div style="font-size: 13px">{{ item.time }}</div>
        <div style="margin-top: 13px">
          <el-badge :value="item.num" type="danger"></el-badge>
        </div>
      </div>
    </el-row>
  </el-main>
</template>

<script setup>
import Header from './Header'
import { ref, reactive } from 'vue'
let list = ref([
  {
    fromId: 1,
    username: '后知后觉',
    message: 'hello this is message listhello this is message listhello this is message listhello this is message list',
    time: '3:15',
    avatar: 'http://q.qlogo.cn/g?b=qq&nk=1220998011&s=160',
    num: 6
  },
  {
    fromId: 2,
    username: '后知后觉',
    message: 'hello this is message list',
    time: '3:15',
    avatar: 'http://q.qlogo.cn/g?b=qq&nk=1220998011&s=160',
    num: 6
  },
  {
    fromId: 3,
    username: '后知后觉',
    message: 'hello this is message list',
    time: '3:15',
    avatar: 'http://q.qlogo.cn/g?b=qq&nk=1220998011&s=160',
    num: 6
  }
])
</script>

<style lang='less' scoped>
/deep/.el-row {
  padding: 5px 10px;
  .message {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: rgb(0, 0, 0, 0.8);
    line-height: 25px;
  }
}
</style>
